groupBrands: [
{
latter: "A",
brands: [
{
id: 'ac',
title: 'AC',
image: ''
},
{
id: 'acura',
title: 'Acura',
image: '/images/acura.svg'
},
]
},
{
latter: "B",
brands: [
{
id: 'BAW',
title: 'BAW',
image: '/images/baw.svg'
},
{
id: 'Bentley',
title: 'Bentley',
image: ''
},
]
},
]
<ul>
<li v-for="groupBrand in groupBrands"
:key="groupBrand.latter"
class="group"
>
<h3>{{ groupBrand.latter }}</h3>
<ul>
<li v-for="brand in groupBrand.brands"
:key="brand.title"
>
<label :for="brand.id">
<input
type="radio"
:id="brand.id"
name="brand"
>
<span>{{ brand.title }}</span>
</label>
</li>
</ul>
</li>
</ul>
How can I output an array in "popular" and "alphabetical" order? In this example, I show it in alphabetical order, but I do not know how to display the "popular" ones that have an image enter image description here